<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html lang="zh-CN">
<head>
<meta content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" name="viewport" />
<meta charset="utf-8">
<title>数据列表</title>
<style type="text/css">
</style>
</head>
<body>
	<table border="1">
		<thead>
			<tr>
				<th>序</th>
				<th>代码</th>
				<th>数据名称</th>
				<th>作者</th>
				<th>使用部门</th>
				<th>描述</th>
				<th>修改时间</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td class="index">序</td>
				<td class="id">代码</td>
				<td class="name">数据名称</td>
				<td class="author">数据名称</td>
				<td class="usr_name">数据名称</td>
				<td class="summary">描述</td>
				<td class="gmt_write">修改时间</td>
				<td><a target="_blank" class="download">下载Excel</a></td>
			</tr>
		</tbody>
	</table>
	<script type="text/javascript" src="static/jquery-1.11.0.js"></script>
	<script type="text/javascript">
		$(function() {
			$.post("query.htm", {
				t : new Date(),
				listId : "SLAVE_TEMPLATE.findSqlData"
			}, function(data) {
				var templateTr = $("tbody").find("tr");
				templateTr.remove();
				for ( var i in data.rows) {
					var row = data.rows[i];
					var newTr = templateTr.clone();
					newTr.find(".index").html(parseInt(i) + 1);
					newTr.find(".id").html(row.id);
					newTr.find(".name").html(row.name);
					newTr.find(".gmt_write").html(new Date(row.gmt_write));
					var content = eval("(" + row.content + ")");
					newTr.find(".author").html(content.author);
					newTr.find(".usr_name").html(content.usr_name);
					newTr.find(".summary").html(content.summary);
					newTr.find(".download").attr("href",
							"data_export.htm?id=" + row.id);
					$("tbody").append(newTr);
				}
			}, "json");
		});
	</script>
</body>
</html>